import request from '@/utils/request'

/**
 * 条件分页查询动态数据
 * @param {*} dto 
 * @returns 
 */
export const getNotesListQuerySevice = (dto) => {
    return request.get('/admin/notes/page', {
        params: dto
    })
}

/**
 * 新增动态
 * @param {*} status 
 * @param {*} notes 
 * @returns 
 */
export const addNotesService = (status,notes) => {
    return request.post(`admin/notes/${status}`,notes)
}

/**
 * 批量删除动态数据
 * @param {*} ids 
 * @returns 
 */
export const deleteBatchService = (ids) => {
    return request.delete('/admin/notes', {
        data: ids
    })
}

/**
 * 批量修改动态状态字段
 * @param {*} statusObj 
 * @returns 
 */
export const updateBatchStatusService = (statusObj) => {
    return request.put('/admin/notes/update',statusObj)
}

/**
 * 根据id查询动态数据
 * @param {*} id 
 * @returns 
 */
export const getNotesByIdService = (id) => {
    return request.get(`/admin/notes/${id}`)
}

/**
 * 根据id修改动态数据
 * @param {*} query 
 * @returns 
 */
export const updateNoteByIdService = (query) => {
    return request.put('/admin/notes/update/note', query)
}